package com.atguigu.study.controller;

import dev.langchain4j.model.chat.ChatModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Marco
 * @Description
 * @date 2025/8/16 23:19
 * @email 3293336923@qq.com
 */
@Slf4j
@RestController
public class PopularIntegrationController {

    @Autowired
    private ChatModel  chatModel;

    @GetMapping("lc4j/boot/chat")
    public       String   chat(@RequestParam(name="prompt" , defaultValue = "你是睡?") String    prompt){

        String result = chatModel.chat(prompt);
        log.info("result:{}",result);
        return  result;
    }
}
